#ifndef SQLPARSER_SQLSTATEMENT_H
#define SQLPARSER_SQLSTATEMENT_H

#include <vector>

#include "Expr.h"

namespace hsql {
enum StatementType {
  kStmtError,   // unused
  kStmtSelect,  // select
  kStmtImport,  // import
  kStmtInsert,  // insert
  kStmtUpdate,  // update
  kStmtDelete,  // delete
  kStmtCreate,  // create
  kStmtDrop,    // drop
  kStmtPrepare, // prepare
  kStmtExecute, // execute
  kStmtExport,  // export
  kStmtRename,  // rename
  kStmtAlter,   // alter
  kStmtShow,    // show
  kStmtTransaction  // transaction
};

// Base struct for every SQL statement
struct SQLStatement {
  SQLStatement(StatementType type);

  virtual ~SQLStatement();

  StatementType type() const;

  bool isType(StatementType type) const;

  // Shorthand for isType(type).
  bool is(StatementType type) const;

  // Length of the string in the SQL query string
  size_t stringLength;

  std::vector<Expr*>* hints;

 private:
  StatementType type_;
};

}  // namespace hsql

#endif  // SQLPARSER_SQLSTATEMENT_H
